from flask import Flask
from flask_wtf.csrf import CSRFProtect
from flask_bootstrap import Bootstrap
from flask_nav import Nav
from flask_nav.elements import *
from config import config


csrf = CSRFProtect()
# 实例化Nav
nav = Nav()

app = Flask(__name__)
app.config.from_object('config')
app.config['SECRET_KEY'] = config.SECRET_KEY

# 初始化app
csrf.init_app(app=app)

# 2. 注册 navigation item
nav.register_element('top', Navbar(
    '选择基金',
    View('首页', 'index'),
    ))


# 初始化app
nav.init_app(app=app)


boostrap = Bootstrap(app=app)
